<?php
require_once('includes/general.php');
if(!tep_db_checkDb()) die('khong ket noi dc csdl');
$masp=$_GET['masp'];
$sql='select * from tbl_san_pham_moi where id='.$masp;
$kq=tep_db_query($sql);

  $content='';
if($_SESSION['nn']=='vn'){
  
  $content.='  <div id="center">
        <div class="tt_sanpham">
            <div class="tieude_dm" ><h3>sản phẩm mới</h3></div>';
        while($item=tep_db_fetch_array($kq)){
            $content.='
             
            
            <div class=noidung_chitiet>
                <div class="hinhanh"><img  height="300" width="300" src="admincp/upload/'.$item['hinh_anh'].'"/>
                   
                </div>
                <div class="ten_ctsp">  '.$item['mo_ta_chi_tiet_vn'].'</div>
                

            </div>
                
                ';
                
        }

$content.='
        </div>
        <div class="clear"></div>
        <div class="sanphamcungloai">
        
            <div class="tt_sanpham">
            <div class="tieude_dm" id="tieude_spcungloai"><h3>sản phẩm cùng loại</h3></div>';
            $sql4='select * from tbl_san_pham_moi where id!='.$masp.'';
            $kq4=tep_db_query($sql4);
            while($item1=tep_db_fetch_array($kq4)){
            $content.='
             
            <div class="show_sanpham">
                <div class="hinhanh_sp" style="margin-bottom:10px;"><a href="?masp='.$item1['id'].'"><img  height="110" width="110" src="admincp/upload/'.$item1['hinh_anh'].'"/></a></div>
                
                <div class="tieude_sp">
                    <div class="ten_sp_center" style="margin-top: 5px;"><a href="?masp='.$item1['id'].'">'.$item1['ten_san_pham_vn'].'</a></div>
                   </div>
            </div>
                
                ';
                
        }

        
       $content.=' 
        </div>
        </div>
       
    </div> 
    
';
}
if($_SESSION['nn']=='en'){
  $content.='  <div id="center">
        <div class="tt_sanpham">
            <div class="tieude_dm" ><h3>New product</h3></div>';
        while($item=tep_db_fetch_array($kq)){
            $content.='
             
            
            <div class=noidung_chitiet>
                <div class="hinhanh"><img  height="300" width="300" src="admincp/upload/'.$item['hinh_anh'].'"/>
                   
                </div>
                <div class="ten_ctsp">  '.$item['mo_ta_chi_tiet_en'].'</div>
                

            </div>
                
                ';
                
        }

$content.='
        </div>
        <div class="clear"></div>
        <div class="sanphamcungloai">
        
            <div class="tt_sanpham">
            <div class="tieude_dm" id="tieude_spcungloai"><h3>same product</h3></div>';
            $sql4='select * from tbl_san_pham_moi where id!='.$masp.'';
            $kq4=tep_db_query($sql4);
            while($item1=tep_db_fetch_array($kq4)){
            $content.='
             
            <div class="show_sanpham">
                <div class="hinhanh_sp" style="margin-bottom:10px;"><a href="?masp='.$item1['id'].'"><img  height="110" width="110" src="admincp/upload/'.$item1['hinh_anh'].'"/></a></div>
                
                <div class="tieude_sp">
                    <div class="ten_sp_center" style="margin-top: 5px;"><a href="?masp='.$item1['id'].'">'.$item1['ten_san_pham_en'].'</a></div>
                   </div>
            </div>
                
                ';
                
        }

        
       $content.=' 
        </div>
        </div>
       
    </div> 
';

}
echo $content;
?>